import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/check/api/check/item/group/query/page',
    method: 'get',
    params: query
  })
}
// 列表不分页
export function fetchListNoPage(params) {
  return request({
    url: '/check/api/check/item/group/query/list',
    method: 'get'
    // params: query
  })
}
// 保存
export function saveInfo(query) {
  if (query.id) {
    return request({
      url: '/check/api/check/item/group/batch',
      method: 'put',
      data: [query]
    })
  } else {
    return request({
      url: '/check/api/check/item/group',
      method: 'post',
      data: query
    })
  }
}
// 详细信息
export function fetchDetailInfo(query) {
  return request({
    url: '/check/api/check/item/group/query/' + query,
    method: 'get'
  })
}
// 导出
export function exportFile(params) {
  return request({
    url: '/device/api/device/exportExcel',
    method: 'get'
  })
}
// 下载批量导入模板

export function downloadTemplete(query) {
  return request({
    url: '/check/api/check/item/group/download/template',
    method: 'get',
    params: query
  })
}
// 删除台账
export function deleteDeviceInfo(query) {
  return request({
    url: '/check/api/check/item/group/batch/',
    method: 'delete',
    data: [query] // 批量删除
  })
}
// 启用
export function startUserInfo(query) {
  return request({
    url: '/user/api/user/start/' + query,
    method: 'put'
    // data: query
  })
}
// 停用
export function stopUserInfo(query) {
  return request({
    url: '/user/api/user/stop/' + query,
    method: 'put'
    // data: query
  })
}
